﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Windows.Devices.Geolocation;

namespace Eatime.Bussiness
{
    public class UserService
    {
        private Geolocator _geolocator = null;
        private CancellationTokenSource _cts = null;
        public async Task<Geoposition> GetPostion()
        {
            _geolocator = new Geolocator();
            _cts = new CancellationTokenSource();
            CancellationToken token = _cts.Token;
            Geoposition pos = await _geolocator.GetGeopositionAsync().AsTask(token);
            return pos;
        }
    }
}
